#pragma once

template<class Iterator,class Ref,class Ptr>
class Reverse_Iterator
{
public:
	typedef Reverse_Iterator<Iterator,Ref,Ptr> Slef;

	Reverse_Iterator(Iterator it)
		:_it(it)
	{}

	Ref operator*()
	{
		Iterator tmp = _it;
		return *(--tmp);
	}

	Ptr operator->()
	{
		
		return *(operator*());
	}


	Slef& operator++()
	{
		--it;
		return *this;
	}

	Slef& operator--()
	{
		++it;
		return *this;
	}

	bool operator!=(const Slef& s)
	{
		return _it != s._it;
	}
private:
	Iterator _it;
};
